home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 695 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.7 KB

  1. Path: pn.itnet.it!not-for-mail
  2. From: "Stefano Agostinelli" <agos001@pn.itnet.it>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Help me with a basic MUI program PLEASE?
  5. Date: Tue, 09 Jan 1996 20:39:05 +0100
  6. Organization: ITnet
  7. Message-ID: <65641108%agos001@pn.itnet.it>
  8. References: <2440.6581T1279T1051@in.net>
  9. NNTP-Posting-Host: agos001.pn.itnet.it
  10. X-NewsReader: IntuiNews 1.3 (27.8.95)
  11.  
  12. John J. Maver wrote in comp.sys.amiga.programmer about "Help me with a basic MUI
  13. program PLEASE?":
  14. > Could someone please help me with MUI?  I have started trying to use
  15. > MUIBuilder,and I can't seem to make a good main.c to control the code it
  16. > generates.  I am new to MUI.  All I want to know is how to open the window
  17. > and then when the person hits the close gadget, have the window close.  With
  18. > my existing main.c. the window opens and is open for good!!
  19. > Is there a good reference for MUI?  Some basic examples, not some 18 part
  20. > multiprogram.
  21.  
  22.  I've looked at your code...well I don't like it. MUIBuilder is useless
  23.  imho: it's much better to write applications "by hand" using MUI C macros.
  24.  For some good serious MUI C example take mui31dev.lha from Aminet and
  25.  have a in depth look at the demo code:you can find basic and not-so-basic
  26.  examples there.
  27.  Ok let's examine the code you posted...
  28.  
  29. > struct ObjApp { APTR    App; APTR    WI_label_0; };
  30.  
  31.  This is pure crap imho. Build a subclass for that...no it's not difficult!
  32.  Just look at some examples in mui31dev packet.
  33.  
  34. > DoMethod(Object->WI_label_0, MUIM_Window_SetCycleChain, 0 );
  35.  
  36.  Useless and btw MUIM_Window_SetCycleChain is obsolete.
  37.  
  38. > set(Object->WI_label_0, MUIA_Window_Open, TRUE );
  39.  
  40.  Ok,now you have opened your window.In order to close automatically
  41.  just tell MUI to notify your window when the user hits the close gadget
  42.  and quit the application.You can done this by adding:
  43.  
  44.  DoMethod(Object->WI_label_0,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,Object->App,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
  45.  
  46.  or to close the window just add
  47.  
  48.  DoMethod(Object->WI_label_0,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,Object->WI_label_0,3,MUIM_Set,MUIA_Window_Open,FALSE);
  49.  
  50.  Hope this helps.
  51.  
  52.  Cheers
  53. Stefano
  54.  
  55. +-----------------------------+-----------------------------------------+
  56. | Stefano Agostinelli         | Now developing for You ARM:             |
  57. | Genoa - Italy               | the State of Art AmigaRoleMaster System |
  58. +-----------------------------+-----------------------------------------+
  59. | IRC: arm                    | 'Where are you going, Master?'          |
  60. | E-mail: agos001@pn.itnet.it | 'To the Havens, Sam'                    |
  61. +-----------------------------+-----------------------------------------+
  62.  
  63.